package com.szj.service.impl;

import com.szj.entity.Admin;
import com.szj.entity.LoginForm;
import com.szj.mapper.AdminMapper;
import com.szj.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;

    //管理员登录
    @Override
    public Admin login(LoginForm loginForm) {
        return adminMapper.login(loginForm);
    }

    //根据用户名查询用户列表或者指定用户数据
    @Override
    public List<Admin> selectList(Admin admin) {
        return adminMapper.selectList(admin);
    }

    @Override
    public int adminDel(Integer[] ids) {
        return adminMapper.adminDel(ids);
    }

    @Override
    public int adminUP(Admin admin) {
        return adminMapper.adminUP(admin);
    }

    @Override
    public int addAdmin(Admin admin) {
        return adminMapper.adminAdd(admin);
    }

    @Override
    public Admin findAdminName(String name) {
        return adminMapper.findAdminName(name);
    }


    @Override
    public int updatePassword(Admin admin) {
        return adminMapper.updatePassword(admin);
    }
}